from SimpleXMLRPCServer import SimpleXMLRPCServer

# Create server
server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()

class BCDB:
    def getProtocolVersion(self): 
        return 1.1
    def isBarcode(self, barcode):
        return 1
    def isBarcodeLocal(self, barcode):
	return self.isBarcode(barcode)
		
    def getBarcodeTitle(self, barcode):
        return "CSS versions 1 et 2"
    def getBarcodeFields(self, barcode):
		return {"Editeur": "ENI Editions", "Collection": "Open IT"}
    
server.register_instance(BCDB())

# Run the server's main loop
server.serve_forever()
